//
//  BillTabsViewController.swift
//  LGMusic
//
//  Created by 梁尚嘉 on 2017/3/29.
//  Copyright © 2017年 LimeGah. All rights reserved.
//

import UIKit

class BillTabsViewController: BaseTabsViewController {

    override func viewDidLoad() {
        super.viewDidLoad()

        let billTypeKeyValues = [
            ["title":"新歌榜","type":"1"],
            ["title":"热歌榜","type":"2"],
            ["title":"摇滚榜","type":"11"],
            ["title":"爵士","type":"12"],
            ["title":"流行","type":"16"],
            ["title":"欧美金曲榜","type":"21"],
            ["title":"经典老歌榜","type":"22"],
            ["title":"情歌对唱榜","type":"23"],
            ["title":"影视金曲榜","type":"24"],
            ["title":"网络歌曲榜","type":"25"],
            ]
        let billTypes = [BillType].deserialize(from:billTypeKeyValues.toJSONString())

        var titles:[String] = []
        var controllers:[BillListTableViewController] = []
        for billType:BillType in billTypes as! [BillType] {
            let billListCtrl = BillListTableViewController()
            billListCtrl.billType = billType
            titles.append(billType.title!)
            controllers.append(billListCtrl)
        }
        self.titles = titles
        self.controllers = controllers
    }

}
